#Goal for this example:

#Build a static library that defines multiple methods and kernels that
#use each other.
#we than add these to a second static library that again uses some
#of these methods

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
add_library(reloc_lib_a STATIC file1.cu file2.cu file3.cu )

add_library(reloc_lib_b STATIC file4.cu )
target_link_libraries(reloc_lib_b PRIVATE reloc_lib_a)

add_library(reloc_lib_c SHARED file5.cu )
target_link_libraries(reloc_lib_c PRIVATE reloc_lib_a)

add_executable(reloc_exe_1 main1.cpp)
target_link_libraries(reloc_exe_1 PRIVATE reloc_lib_a)

add_executable(reloc_exe_2 main2.cpp)
target_link_libraries(reloc_exe_2 PRIVATE reloc_lib_b reloc_lib_c)

set_target_properties( reloc_lib_a
                       reloc_lib_b
                       reloc_lib_c
                       PROPERTIES CUDA_SEPARABLE_COMPILATION ON
                                  POSITION_INDEPENDENT_CODE ON)
